home *** CD-ROM | disk | FTP | other *** search
- Path: news.internetMCI.com!news-admin
- From: 74133.2732@compuserve.com
- Newsgroups: comp.lang.c++
- Subject: Creating a 'factory'
- Date: 14 Feb 1996 15:58:19 GMT
- Organization: InternetMCI
- Message-ID: <4ft0qr$10t@news.internetmci.com>
- Reply-To: 74133.2732@compuserve.com (Rich Knapp)
- NNTP-Posting-Host: 166.35.209.252
- X-Newsreader: IBM NewsReader/2 v1.2
-
- I'm trying to build a framework for processing files. Each process has an
- input file and an output file (ASCII). I've built, from a common File object,
- an InputFile and OutputFile object. As part of the functionality, I wanted to
- provide the extraction (>>) and insertion (<<) operator in these classes.
- The InputFile uses getline() to retrieve data for the file. It leaves
- the CR on the data line but strips the LF.
- The OutputFile only inserts the LF, not the CR (checked for hex pair
- OD and OA). I commented out the insertion operator to see if I was
- running into trouble directing the output. No impact on the output. I tried
- a generic stream output and successfully used the << with the correct CR/LF
- pair.
- I can force the CR/LF by putting "/r/n" in the passed character string but
- shouldn't the endl also pass that information.
- I'm really confused on this. BTW, I'm using old Turbo C++ 3.0. (could that
- be the problem?)
-
- rich
-